package es.udima.geo.geoserver.entities;

import java.util.Date;

public class GpsData implements Comparable<GpsData> {

	private Date fetchTime;
	private double lat;
	private double lon;
	private double distanceFromPrevious; //distance from a previous point in meters
	private double lapseTimeFromPrevious; //time from a previous point in milliseconds
	private double speedFromPrevious; //average speed from a previous point in km/h

	public GpsData() {

	}

	public GpsData(Date fetchTime, double lat, double lon) {
		this.fetchTime = fetchTime;
		this.lat = lat;
		this.lon = lon;
	}

	public Date getFetchTime() {
		return fetchTime;
	}

	public void setFetchTime(Date fetchTime) {
		this.fetchTime = fetchTime;
	}

	public double getLat() {
		return lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

	public double getLon() {
		return lon;
	}

	public void setLon(double lon) {
		this.lon = lon;
	}
	
	public double getDistanceFromPrevious() {
	    return distanceFromPrevious;
	}

	public void setDistanceFromPrevious(double distanceFromPrevious) {
	    this.distanceFromPrevious = distanceFromPrevious;
	}

	public double getLapseTimeFromPrevious() {
	    return lapseTimeFromPrevious;
	}

	public void setLapseTimeFromPrevious(double lapseTimeFromPrevious) {
	    this.lapseTimeFromPrevious = lapseTimeFromPrevious;
	}

	public double getSpeedFromPrevious() {
	    return speedFromPrevious;
	}

	public void setSpeedFromPrevious(double speedFromPrevious) {
	    this.speedFromPrevious = speedFromPrevious;
	}

	@Override
	public String toString() {
	    return "GpsData [fetchTime=" + fetchTime + ", lat=" + lat + ", lon=" + lon + ", distanceFromPrevious=" + distanceFromPrevious
		    + ", lapseTimeFromPrevious=" + lapseTimeFromPrevious + ", speedFromPrevious=" + speedFromPrevious + "]";
	}

	@Override
	public int compareTo(GpsData o) {
		return this.getFetchTime().compareTo(o.getFetchTime());
	}

}
